package com.dongl.jwtdemo.modules;

import com.dongl.jwtdemo.modules.entity.UserBean;

import java.util.HashMap;
import java.util.Map;

public class DataSource {

    private static Map<String, UserBean> userBeans = new HashMap<>();

    static {
        UserBean u1 = new UserBean();
        u1.setUsername("smith");
        u1.setPassword("smith123");
        u1.setRole("user");
        u1.setPermission("view");

        UserBean u2 = new UserBean();
        u2.setUsername("danny");
        u2.setPassword("danny1234");
        u2.setRole("admin");
        u2.setPermission("view,edit");

        userBeans.put(u1.getUsername(), u1);
        userBeans.put(u2.getUsername(), u2);
    }

    public static Map<String, UserBean> getData(){
        return userBeans;
    }


}
